//共用方法
var CACHE_ID = {};

//＊需統一格式
var G_TMP = {};
var IMG = {};
var RoundSerial = '';
var RoundID = '';
var f_w = {};
var DispDetail = {};
var GameEndTime = {};
//var OddInfo = {};
var LimitInfo = {};
//賠率時間
var CATCH_ODD = {};
//common method object
var QSFUN = {};
/**
 *  get object or array length
 *  return @int
 */
 
 
 
  function	onlineBank(obj)
  {
//  	alert('a');
  	window.location.href="payonline.php?userid=" + obj;
  }
  
  function	unlineBank(obj)
  {
  	window.location.href="paybank.php?userid=" + obj;
  }
  
  function	offlinePay(obj, uid)
  {
  	var vurl = "pay" + obj + ".php";
  	window.location.href=vurl + "?userid=" + uid;
  }
  
  
QSFUN.count = function (o) {
    var num = 0;
    if (typeof(o) == 'object') {
        for (var i in o)
            num++;

        return num;
    } else {
        return o.length;
    }
};

//get odd,quota,time
//(method,data) array,string
//callback > success method;
QSFUN.Get = function (data, callback, errorCallback) {
    $.ajax({
        type: 'POST',
        url: ctx + '/member/JsonBetServlet',
        data: QSFUN.postArray(data),
        cache: false,
        async: false,
        dataType: 'json',
        error: errorCallback || function (a, b, c) {
            return;
        },
        success: callback
    });

};


// post array
QSFUN.postArray = function (o) {
    var option = [];
    for (var key in o) {
        if (typeof o[key] == 'array' || typeof o[key] == 'object') {
            for (var i = 0; i < o[key].length; i++) {
                option.push({
                    name: key + '[]',
                    value: o[key][i]
                });
            }
        } else if (typeof o[key] == 'string' || typeof o[key] == 'number') {
            option.push({
                name: key,
                value: o[key]
            });
        }
    }
    return option;
};

// delete object last value
// example: pop({a:1,b:2})
// result : return b;
QSFUN.pop = function (o) {
    var j = QSFUN.count(o);

    $.each(o, function (i, v) {
        alert(k);
        if (j == k)delete v;

        k++;
    });
};


/* @example
 * $.timer(1000, function (timer) {
 * 	alert("hello");
 * 	timer.stop();
 * });
 * @desc Show an alert box after 1 second and stop
 *
 * @example
 * var second = false;
 *	$.timer(1000, function (timer) {
 *		if (!second) {
 *			alert('First time!');
 *			second = true;
 *			timer.reset(3000);
 *		}
 *		else {
 *			alert('Second time');
 *			timer.stop();
 *		}
 *	 });
 */
QSFUN.Ti = function (interval, callback) {
    interval = interval || 1000;

    if (!callback)return false;

    var _timer = function (interval, callback) {
        var self = this;
        if (self.id != null) clearInterval(self.id);

        this.stop = function () {
            clearInterval(self.id);
        };
        this.internalCallback = function () {
            callback(self);
        };
        this.reset = function (val) {
            if (self.id) clearInterval(self.id);
            self.id = setInterval(this.internalCallback, val || 1000);
            self.interval = val;
        };
        this.interval = interval;
        this.id = setInterval(this.internalCallback, this.interval);
    };
    return new _timer(interval, callback);
};

// getElementById() cache
// return jquery object or jquery[0] == getElementById();
QSFUN.cache = function (id) {

    if (CACHE_ID[id] === void 0) CACHE_ID[id] = $('#' + id);

    return CACHE_ID[id];
};

QSFUN.setCookie = function (theName, theValue, theDay) {
    if ((theName != "") && (theValue != "")) {
        expDay = "Web,01 Jan 2020 18:56:35 GMT";
        if (theDay != null) {
            theDay = eval(theDay);
            setDay = new Date();
            setDay.setTime(setDay.getTime() + (theDay * 1000 * 60 * 60 * 24));
            expDay = setDay.toGMTString();
        }
        //document.cookie = theName+"="+escape(theValue)+";expires="+expDay;
        document.cookie = theName + "=" + escape(theValue) + ";path=/;expires=" + expDay + ";";
        return true;
    }
    return false;
};
QSFUN.delCookie = function (theName) {
    document.cookie = theName + "=;expires=Thu,01-Jan-70 00:00:01 GMT";
    return true;
};
QSFUN.getCookie = function (theName) {
    theName += "=";
    theCookie = document.cookie + ";";
    start = theCookie.indexOf(theName);
    if (start != -1) {
        end = theCookie.indexOf(";", start);
        return unescape(theCookie.substring(start + theName.length, end));
    }
    return false;
};


// correct return true ,fail return false;
QSFUN.isGold = function (v) {
    var RegExps = {};
    RegExps.isNumber = /^[-\+]?\d+$/;
    if (RegExps['isNumber'].test(v))
        return true;

    return false;
};

//電子遊藝專用
QSFUN.getGamePager = function (type, me, id, gameIndex) {
	    if ("pt" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=PT";
	    }else if ("ogg" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=OG";
	    }else if ("mwg" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=MW";
	    }else if ("nmg" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=NMG";
	    }else if ("pp" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=PP";
	    }else if ("cq9" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=CQ9";
	    }else if ("png" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=PNG";
	    }else if ("jdb" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=JDB";
	    }else if ("ag" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=AG";
	    }else if ("yoplay" == id) {
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage.jsp?gameIndex=' + gameIndex + "&elecGameflag=YOPLAY";
	    }else if("casino" == id) { 
	        top.location.href = ctx + '/jsp/member/electronicGame/elecGamePage' + (gameIndex == 1 ? '' : gameIndex) + '.jsp?gameIndex=' + gameIndex + "&elecGameflag=MG";
	    }else {
	    	top.location.href = ctx + '/jsp/member/index.jsp';
	    }
    /*if(type.charAt(0) == '-'){
     top.location.href = ctx+'/jsp/member/elgame'+(gameIndex==1 ?'':gameIndex)+'.jsp?gameIndex='+gameIndex;
     }else{
     //	getGameList(gameIndex);  //改为动态显示游戏时使用,暂时不用
     $("div[id^='"+id+"-']").hide();
     $("div#"+id+"-"+gameIndex).show();
     if($("h3[id^='#"+id+"-']")){
     $("h3[id^='#"+id+"-']").next("ul").hide();
     $("h3[id^='#"+id+"-"+gameIndex+"']").next("ul").show();
     }
     }*/
};

QSFUN.bm = function (url, n, o) {
    var conf = {
        width: '1024',
        height: '768',
        scrollbars: 'yes',
        resizable: 'no',
        status: 'no',
        location: 'yes',
        toolbar: 'no',
        menubar: 'no'
    }, _tmp = [];
    if (o == undefined) o = {};

    // 特例:如為電子遊藝-玉蒲團的搶先看 則設定寬高
    if (/(PriorityWatch)/.test(url)) {
        o = {
            'width': '960',
            'height': '640',
            'scrollbars': 'no'
        };
    }

    // 特例:如為真人娛樂-BB3D開啟遊戲 則以location的方式連結
    if (/(LiveBB3D|LiveBBK8)/.test(url)) {
        self.location = url;
    } else {
        for (var k in conf) {
            _tmp.push(k + '=' + ((o[k] == undefined) ? conf[k] : o[k]));
        }
        window.open(url, n, _tmp.join(','));
    }
};

/*會員中心換頁*/

QSFUN.__options = {
    type: "POST",
    dataType: "html",
    module: ctx + "/member/memberCentre",
    method: "memberdata",
    timeout: 120000,
    blockUI: true,
    blockId: "#page-container",
    blockStyle: "white",
    maskColor: "#000000"
}
QSFUN.SetOptions = function (key, value) {
    QSFUN.__options[key] = value;
};

//免费试玩  by chopper 检查会员对此功能是否有权限操作
function checkFreeMember() {
    var conversionFlag = false;
    $.ajax({
        type: "post",
        async: false,//false代表只有在等待ajax执行完毕后才执行 也就是同步
        url: ctx + "/member/memberCentre?method=checkAccountType",
        contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
        dataType: "json",
        success: function (data) {
            conversionFlag = data.success;
        }
    });
    return conversionFlag;
}

//免费试玩  by robben 检查会员对此功能是否有权限操作
function checkTestMember(checkFlag) {
	if(!checkFlag || typeof checkFlag =='undefined'
		          ||checkFlag==null
		          ||checkFlag==''){
		checkFlag = '0';
	}
    var conversionFlag = false;
    $.ajax({
        type: "post",
        async: false,//false代表只有在等待ajax执行完毕后才执行 也就是同步
        url: ctx + "/member/memberCentre?method=checkAccountType&isCheckTestMember="+checkFlag,
        contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
        dataType: "json",
        success: function (data) {
            conversionFlag = data.success;
        }
    });
    return conversionFlag;
}

function checkAccountType(accountType_) {
	var isValid = false;
	$.ajax({
		type: "post",
		async: false,//false代表只有在等待ajax执行完毕后才执行 也就是同步
		url: ctx + "/member/memberCentre?method=checkSingleAccountType&accountType="+accountType_,//试玩账号和测试线账号分开校验
		contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
		dataType: "json",
		success: function (data) {
			isValid = data.success;
		}
	});
	return isValid;
}

QSFUN.MGetPager = function (mo, me, oth, open) {
    var param = "";
    if (oth) {
        if (typeof oth == "object") {
            param = jQuery.param(oth);
        }
        if (typeof oth == "string") {
            param = oth;
        }
        if (param.indexOf("&") == -1) {
            param = "&" + param;
        }
    }

    //免费试玩  by nissen 如果是试玩会员,提示不支持试玩会员取款
    if (me == "bankTake") {
        if (checkFreeMember()) {
            alert("试玩账号不支持此功能！");
            return;
        }
    }
    /*if (open) {
        window.open(ctx + "/member/" + mo + "?module=" + me + param, "_self");
    } else {
        window.open(ctx+"/member/" + mo + "?module=" + me+param, "MACENTER", "top=50,left=50,width=1020px,height=800px,status=no,scrollbars=yes,resizable=no").focus();
    }*/

    window.open(ctx+"/member/" + mo + "?module=" + me+param, "MACENTER", "top=50,left=50,width=1020px,height=800px,status=no,scrollbars=yes,resizable=no").focus();
};

QSFUN.MChgPager = function (options, otherData) {

    var conf = $.extend(QSFUN.__options, options);

    //免费试玩  by nissen 如果是试玩会员,提示不支持试玩会员取款
    if ("bankTake" == conf.method) {
        if (checkFreeMember()) {
            alert("试玩账号不支持此功能！");
            return;
        }
    }
    //测试会员不允许做额度转换 modify by robben 如果是测试会员 提示额度转换不对测试账号开放！
//    if ("moneyConversion" == conf.method) {
//        if (checkTestMember('0')) {
//            alert("额度转换不对测试账号开放！");
//            return;
//        }
//    }
    
    var data = {"method": conf.method};
    if (otherData) {
        $.extend(data, otherData);
    }
    if (conf.blockUI) {
        $(conf.blockId).block({
            message: "<div id='MBlockImg'></div>",
            centerY: 0,
            css: {
                "background-color": "transparent",
                top: "300px",
                width: '0px',
                border: "none",
                cursor: "default"
            },
            overlayCSS: {
                cursor: "default",
                backgroundColor: conf.maskColor
            }
        });

    }
    $.ajax({
        type: conf.type,
        url: conf.module,
        data: data,
        dataType: conf.dataType,
        timeout: conf.timeout,
        cache: false,
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //console.log(XMLHttpRequest.status);
            if (XMLHttpRequest.responseText.indexOf("您过于频繁操作，请稍等几秒钟后再访问，敬请见谅") > 0) {
                alert("您过于频繁操作，请稍等几秒钟后再访问，敬请见谅。");
                return;
            } else if (XMLHttpRequest.status == 403) {
                //如果是系统判断成403返回，那么认为是频繁访问造成的。
                alert("您过于频繁操作，请等下一分钟再访问，敬请见谅。");
                setTimeout(function() {
                	//QSFUN.MChgPager({method: "bankSavings"});
                	QSFUN.MChgPager({method: conf.method});
        		},2000);
                return;
            } else {
                alert(JsBook.S_MSG_TRAN_BUSY);
            }
        },
        success: function (data) {
            try {
                var d = $.parseJSON(data);
                alert(d.msg);
                window.close();
            } catch (e) {
            }
            $('#MACenter-content').html("");
            $('#MACenter-content').html(data);
            if ($("#sowErrorMsg").size() > 0) {
                alert($("#sowErrorMsg").text());
            }
        },
        complete: function () {

            if (conf.blockUI && typeof $(conf.blockId).unblock == "function") {
                $(conf.blockId).unblock();
            }
        }
    });
}


function findObj(b, a) {
    var e, c, d;
    if (!a) {
        a = document
    }
    if ((e = b.indexOf("?")) > 0 && parent.frames.length) {
        a = parent.frames[b.substring(e + 1)].document;
        b = b.substring(0, e)
    }
    if (!(d = a[b]) && a.all) {
        d = a.all[b]
    }
    for (c = 0; !d && c < a.forms.length; c++) {
        d = a.forms[c][b]
    }
    for (c = 0; !d && a.layers && c < a.layers.length; c++) {
        d = findObj(b, a.layers[c].document)
    }
    if (!d && document.getElementById) {
        d = document.getElementById(b)
    }
    return d
}
function showHideLayers() {
    var b, d, c, a = showHideLayers.arguments;
    for (b = 0; b < (a.length - 2); b += 3) {
        if ((c = findObj(a[b])) != null) {
            d = a[b + 2];
            if (c.style) {
                c = c.style;
                if (d == "show") {
                    d = "visible"
                } else {
                    if (d == "hide") {
                        d = "hidden"
                    }
                }
            }
            c.visibility = d
        }
    }
};

function SecondMenu(a, b) {

    a.hover(function () {
        b.show();
    }, function () {
        b.hide();
    });

    b.hover(function () {
        b.show();
    }, function () {
        b.hide();
    });
}
/* 
 * 方法名称：secondMenu
 * 开发时间：2018.3.22
 * 开发人员：Baker
 * 参数说明：
 	fid   一级导航栏ID;
 	sid   二级导航栏ID; 
 	way   二级导航栏显示方式【IO:显示隐藏 UD：向下滑动】;
 	stime 二级导航栏 显示过度时间 单位为毫秒;
 *
 */
function newSecondMenu(fid, sid, way, stime) {
	if(way === "IO"){ //二级导航栏显示隐藏效果展示
		fid.hover(function () {
			if(sid.css("display")=="block"){
				sid.stop(true,true).css("display","block");
			}else{
				sid.stop(false,true).fadeIn(stime);
			}
	    }, function () {
	    	sid.stop(false,true).fadeOut(stime);
	    });
		sid.hover(function () {
			sid.stop(true,true).css("display","block");
	    }, function () {
	    	sid.stop(true,true).fadeOut(stime);
	    });
	} else if(way === "UD"){ //二级导航栏 向下滑动效果展示
		fid.hover(function () {
			if(sid.css("display")=="block"){
				sid.stop(true,true).css("display","block");
			}else{
				sid.stop(false,true).slideDown(stime);
			}
	    }, function () {
	    	sid.stop(false,true).slideUp(stime);
	    });
		sid.hover(function () {
			sid.stop(true,true).css("display","block");
	    }, function () {
	    	sid.stop(true,true).slideUp(stime);
	    });
	}else{
		fid.hover(function () {  //默认隐藏显示行为
			sid.show();
	    }, function () {
	    	sid.hide();
	    });
		sid.hover(function () {
			sid.show();
	    }, function () {
	    	sid.hide();
	    });
	}
}

QSFUN.disableClick = function (href) {
    href.attr("href", "javascript:void(0);")
}


//切换彩票方法
function targetLottery(name) {
    var browser = navigator.appName;
    var b_version = navigator.appVersion;
    var version = b_version.split(";");
    if (version && version.length > 1) {
        var trim_Version = version[1].replace(/[ ]/g, "");
        if (browser == "Microsoft Internet Explorer" && (trim_Version == "MSIE6.0" || trim_Version == "MSIE7.0" || trim_Version == "MSIE8.0" || trim_Version == "MSIE9.0")) {
            alert("您的浏览器版本过低，请您升级浏览器版本或更换其他浏览器");
            return;
        }
    }
    var res= true;
    //暂时先去掉控制
    // var res = null;
//    $.ajax({
//        type: 'get',
//        url: ctx + "/member/vender?method=isEabledToNewLottery&lotteryId=" + (name.replace(/[a-zA-Z]+/, '')) + "&rnd=" + Math.random(),
//        cache: false,
//        async: false,
//        dataType: 'json',
//        success: function (data) {
//            res = data;
//        }
//    });
    if (true == res) {
        toLotteryPage(name);
    } else if (false == res) {
        alert("对不起！当前游戏尚未开启，请您选择其他游戏进行投注！");
    } else if (typeof res == "string") {
        alert(res);
    } else {
        alert(res.msg);
    }
}

function toLotteryPage(name) {
//    var url = ctx + '/jsp/member/lotteryV2/index.jsp';
//    if (name == "LT2") {
//        //重庆彩票
//        url += "#/app/cqssc";
//    } else if (name == "LT3") {
//        //天津
//        url += "#/app/tjssc";
//    } else if (name == "LT24") {
//        //六合彩
//        url += "#/app/lhc";
//    } else if (name == "LT4") {
//        //江西时时彩
//        url += "#/app/jxssc";
//    } else if (name == "LT7") {
//        //江苏骰宝
//        url += "#/app/jstb";
//    } else if (name == "LT5") {
//        //广东快乐十分
//        url += "#/app/gdklsf";
//    } else if (name == "LT6") {
//        //北京赛车
//        url += "#/app/bjsc";
//    } else if (name == "LT9") {
//        //幸运28
//        url += "#/app/ddcp";
//    } else if (name == "LT9") {
//        //幸运28
//        url += "#/app/ddcp";
//    } else if (name == "LT10") {
//        //湖南快乐十分
//        url += "#/app/hnklshf";
//    } else if (name == "LT11") {
//        //新疆时时彩
//        url += "#/app/xjssc";
//    } else if (name == "LT13") {
//        //重庆幸运农场
//        url += "#/app/cqxync";
//    } else if (name == "LT14") {
//        //广西快三
//        url += "#/app/gxk3";
//    } else if (name == "LT15") {
//        //北京快乐8
//        url += "#/app/bjkl8";
//    } else if (name == "LT16") {
//        //广西快乐十分
//        url += "#/app/gxklsf";
//    } else if (name == "LT17") {
//        //广东11选5
//        url += "#/app/gd11x5";
//    } else if (name == "df44") {
//        //东方1分 赛车
//        url += "#/app/df1sc";
//    }else if (name == "df73") {
//        //东方1分 幸运农场
//        url += "#/app/yfxync";
//    }else if (name == "df50") {
//        //东方1分 东方骰宝
//        url += "#/app/df1tb";
//    }else if (name == "df55") {
//        //东方1分 东方幸运28
//        url += "#/app/df1xy28";
//    }else if (name == "df57") {
//        //东方1分 东方11选5
//        url += "#/app/yf11x5";
//    }else if (name == "df64") {
//        //东方1分 东方六合彩
//        url += "#/app/df1lhc";
//    }else if (name == "df60") {
//        //东方1分 东方快乐十分
//        url += "#/app/df1klsf";
//    }else if (name == "df40") {
//        //东方1分 东方时时彩
//        url += "#/app/df1ssc";
//    }else if (name == "df53") {
//        //东方1分 东方快乐8
//        url += "#/app/df1kl8";
//    }else if (name == "df51") {
//        //东方3分 东方骰宝
//        url += "#/app/df3tb";
//    }else if (name == "df74") {
//        //东方3分 东方幸运农场
//        url += "#/app/sfxync";
//    }else if (name == "df56") {
//        //东方3分 东方幸运28
//        url += "#/app/df3xy28";
//    }else if (name == "df58") {
//        //东方3分 东方11选五
//        url += "#/app/sf11x5";
//    }else if (name == "df65") {
//        //东方3分 东方六合彩
//        url += "#/app/df3lhc";
//    }else if (name == "df42") {
//        //东方3分 东方时时彩
//        url += "#/app/df3ssc";
//    }else if (name == "df45") {
//        //东方3分 东方赛车
//        url += "#/app/df3sc";
//    }else if (name == "df61") {
//        //东方3分 东方快乐十分
//        url += "#/app/df3klsf";
//    }else if (name == "df54") {
//        //东方3分 东方快乐8
//        url += "#/app/df3kl8";
//    }else if (name == "df52") {
//        //东方5分 东方骰宝
//        url += "#/app/df5tb";
//    }else if (name == "df49") {
//        //东方5分 东方幸运农场
//        url += "#/app/df5xync";
//    }else if (name == "df59") {
//        //东方5分 东方11选5
//        url += "#/app/df5115";
//    }else if (name == "df66") {
//        //东方5分 东方六合彩
//        url += "#/app/df5lhc";
//    }else if (name == "df67") {
//        //东方5分 东方赛车
//        url += "#/app/df5sc";
//    }else if (name == "df43") {
//        //东方5分 东方时时彩
//        url += "#/app/df5ssc";
//    }else if (name == "df62") {
//        //东方5分 东方快乐十分
//        url += "#/app/df5klsf";
//    }else if (name == "df68") {
//        //东方5分 东方快乐8
//        url += "#/app/df5kl8";
//    }
		if(name.length>2){
			var gameId = name.substring(2,name.length);
		    var url = ctx + '/member/flex?type=loginapi&key=cp&gameId='+gameId;
		}else{
			 alert("对不起！当前游戏id错误,请联系客服！");
		}
		var left = 0;
		var params = 
			'width='+(window.screen.availWidth)+
			',height='+(window.screen.availHeight)+
			',top=0,left=0,fullscreen=yes' +
			',toolbar=no,menubar=no,scrollbars=yes' 
		 +',resizable=yes,location=yes, status=yes';
	    try {
	        window.open(url, "会员登录", params).focus();
	    } catch (e) {
	        window.open(url, "会员登录", params)
	    }

}


// by nissen  微信登录弹出二维码扫描
function showWx(sId, shopaddr)
{ 
	//添加iframe
    var if_w = 400;
    var if_h = 450; 
    //allowTransparency='true' 设置背景透明
    $("<iframe width='" + if_w + "' height='" + if_h + "' id='YuFrame1' name='YuFrame1' style='position:absolute;z-index:99999999;background-color: azure;'  frameborder='no' marginheight='0' marginwidth='0' allowTransparency='true'></iframe>").prependTo('body');    
    var st=document.documentElement.scrollTop|| document.body.scrollTop;//滚动条距顶部的距离
    var sl=document.documentElement.scrollLeft|| document.body.scrollLeft;//滚动条距左边的距离
    var ch=document.documentElement.clientHeight;//屏幕的高度
    var cw=document.documentElement.clientWidth;//屏幕的宽度
    var objH=$("#YuFrame1").height();//浮动对象的高度
    var objW=$("#YuFrame1").width();//浮动对象的宽度
    var objT=Number(st)+(Number(ch)-Number(objH))/2;
    var objL=Number(sl)+(Number(cw)-Number(objW))/2;
    $("#YuFrame1").css('left',objL);
    $("#YuFrame1").css('top',objT+70);
 
    //add by allen IE11以下浏览器，当点击微信图标的时候，弹出提示，请使用IE11以上版本或者其他浏览器进行微信登录
    if(isLessThanIe11()){
    	setTimeout(function(){
    		$("#YuFrame1").contents().find("body").append("<h1>请使用IE11以上版本或者其他浏览器进行微信登录<h1>");
    	},1); 	
    }else{ 	
    	$("#YuFrame1").attr("src", "https://"+shopaddr+"/weixin/loginjump?state="+sId+"&referer="+encodeURIComponent(document.URL))
    }
   
 
    //添加背景遮罩
    $("<div id='YuFrame1Bg' style='background-color: Gray;display:block;z-index:99999999;position:absolute;left:0px;top:0px;filter:Alpha(Opacity=30);/* IE */-moz-opacity:0.4;/* Moz + FF */opacity: 0.4; '/>").prependTo('body'); 
    var bgWidth = Math.max($("body").width(),cw);
    var bgHeight = Math.max($("body").height(),ch);
    $("#YuFrame1Bg").css({width:bgWidth,height:bgHeight});
 
    //点击背景遮罩移除iframe和背景
    $("#YuFrame1Bg").click(function() {
        $("#YuFrame1").remove();
        $("#YuFrame1Bg").remove();
    });
    /* ref = setInterval (function(){
		wxLogin();
	}, 1000); */
}

/**
 * 判断当前浏览器是否是ie浏览器并低于版本11
 * @returns
 */
function isLessThanIe11(){
    return window.ActiveXObject ? true : false;
}
/**
 * author baker
 * time 2018.6.26
 * 手机投注跳转
 * 
 */
function goMobileBet() {
	  window.open(ctx + '/wap/index',"_blank");
}